In [1]:
import tensorflow as tf
with tf.name_scope("Eqn_1"):
with tf.name_scope("scope1"):
with tf.name_scope("a_square"):
x=tf.square(1,name="a_sq")
with tf.name_scope("b_square"):
y=tf.square(2,name="b_sq")
z=tf.add(x,y,name="sum")
with tf.name_scope("scope2"):
p=tf.multiply(1,2,name="multi_ab")
q=tf.scalar_mul(2,p)
r=tf.add(z,q,name="Final")
with tf.Session() as sess:
writer=tf.summary.FileWriter("/tmp/tboard/output4",sess.graph)
print(sess.run(r))
writer.close()
In [5]:
import tensorflow as tf
with tf.name_scope("Equation_1"):
with tf.name_scope("scope_1"):
with tf.name_scope("A_Square"):
a=tf.square(2,name="a2")
with tf.name_scope("B_square"):
b=tf.square(5,name="b2")
c=tf.add(a,b,name="sum")
with tf.name_scope("scope2"):
p=tf.multiply(2,5,name="mult")
z=tf.scalar_mul(2,p)
res=tf.subtract(c,z,name="final_answer")
with tf.Session() as sess:
writer=tf.summary.FileWriter("/tmp/tboard/output4",sess.graph)
print(sess.run(res))
writer.close()
In [ ]: